/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * fondo.java
 *
 * Created on 27-ene-2012, 16:31:27
 */

package com.cmf.vista;

import com.cmf.controladores.Fondoframe;
import java.awt.image.BufferedImage;
import java.io.File;
import javax.imageio.ImageIO;

/**
 *
 * @author cabarcas
 */
public class Fondo extends javax.swing.JPanel {

    /** Creates new form fondo */
    public Fondo(String n) {
        initComponents();
        try{
            File file=new File("");
            File f=new File(file.getCanonicalPath()+"/src/com/cmf/recursos/imagenes/"+n);
            BufferedImage imagen= ImageIO.read(f);
            Fondoframe bg=new Fondoframe(imagen);
            setBorder(bg);
        }catch(Exception E){}
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0), 3));

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 794, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 594, Short.MAX_VALUE)
        );
    }// </editor-fold>//GEN-END:initComponents


    // Variables declaration - do not modify//GEN-BEGIN:variables
    // End of variables declaration//GEN-END:variables

}
